<?php

/**
 * cari actions.
 *
 * @package    alazhar
 * @subpackage cari
 * @author     Ardhy Widodo
 * @version    SVN: $Id: actions.class.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class cariActions extends sfActions {

    public function __construct($context, $moduleName, $actionName) {
        parent::__construct($context, $moduleName, $actionName);
        $this->getUser()->setAttribute('subsystem', 'bk');
    }

    public function executeProses(sfWebRequest $request) {
        //$this->forward404Unless($request->isMethod(sfRequest::POST));
        $this->keyword = $request->getParameter('teks_cari');
        $this->siswa = Doctrine_Core::getTable('Siswa')
                ->createQuery('s')
                ->where('s.nama_lengkap LIKE ?', '%' . $this->keyword . '%')
                ->orWhere('s.no_induk=?', $this->keyword)
                ->execute();
    }

}
